class replaceSpace {
    public String _replaceSpace(String s) {
        if (s.length() == 0) {
            return s;
        }
        char[] ch = s.toCharArray();
        StringBuilder sb = new StringBuilder();
        for (char c : ch) {
            if (c == ' ') {
                sb.append("%20");
            } else {
                sb.append(c);
            }
        }
        return sb.toString();
    }
}